﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SimpleFactory
{
    public static class ClusteringFactory
    {
        public static IClustering CreateClustering(string clusteringType)
        {
            clusteringType = clusteringType.Trim().ToLower();

            switch (clusteringType)
            {
                case "kmeans":
                    return new KmeansClustering();
                case "dbscan":
                    return new DbscanClustering();
                case "hierarchical":
                    return new HierarchicalClustering();
                default:
                    throw new ArgumentException($"未知的聚类算法类型：{clusteringType}");
            }
        }
    }
}
